<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>trngpsv: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">trngpsv
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Overview</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">trngpsv Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The Xilinx True Random Number Generator (TRNG) module in Versal - PMC TRNG consists of an entropy source, a deterministic random bit generator (DRBG) and health test logic, which tests the randomness of the generated data. The entropy source for the unit is an array of Ring Oscillators.</p>
<p>The Versal PMC TRNG is envisaged to operate in three basic modes: DRNG, PTRNG and HRNG modes. Each of these can be operated with or without Derivative Function (DF), resulting in a total of 6 different modes of operation.</p>
<p>NIST SP-800-90A practically requires the true random generators based on CTR_DRBG to include a derivation function (DF). This is expected to be implemented inside the Silicon (TRNG IP). However, the version of the IP used in Versal PMC doesn't have this implementation. Hence, a software implementation of the DF is done in this driver.</p>
<p>DRNG mode: Deterministic Random Number Generator mode. In this mode, the DRBG portion of the TRNG is used. User provides the (external) seed in this mode. PTRNG mode: Physical True Random Number Generator mode (aka Entropy mode). In this mode digitized Entropy source is output as random number. HRNG mode: Hybrid Random Number Generator mode. This is combination of above two modes in which the Entropy source is used to provide the seed, which is fed to the DRBG, which in turn generates the random number.</p>
<p>DRNG mode with DF: It may not be common usecase to use the DF with DRNG as the general expectation would be that the seed would have sufficient entropy. However, the below guideline from section 10.2.1 of NIST SP-800-90A implies that need for DF for DRNG mode too: "..the DRBG mechanism is specified to allow an implementation tradeoff with respect to the use of this derivation function. The use of the derivation function is optional if either an approved RBG or an entropy source provides full entropy output when entropy input is requested by the DRBG mechanism. Otherwise, the derivation function shall be used". Sufficient large entropy data from user is fed to DF to generate the seed which will be loaded into the external seed registers. From here, it is similar to regular DRNG mode.</p>
<p>PTRNG mode with DF: This mode is similar to PTRNG mode, however, the entropy data from the core output registers are accumulated and fed to the DF (instead of directly consuming it). The output of the DF would be final random data. In this mode, the output of DF is not seed but the random data.</p>
<p>HRNG mode with DF: This mode is the combination of the above two modes. The entropy data is fed to the DF to produce seed. This seed is loaded to the external seed registers which provide seed to the DRBG.</p>
<p>During operation, the driver will be one of the 4 stages as mentioned below. Transition from UNINITIALIZED to HEALTHY happens through the Instantiation process. The state of Uninitialized can be reached from any other state by Uninstantiate operation. ERROR state reached through SW error conditions or through indication of CTF (caused by Certification Randomness Test failure), whereas the CATASTROPHIC_ERROR state results from DTF (i.e. hardware failure).</p>
<p>More description of the driver operation for each function can be found in the <a class="el" href="xtrngpsv_8c.html">xtrngpsv.c</a> file.</p>
<p>This driver is intended to be RTOS and processor independent. It works with physical addresses only. Any needs for dynamic memory management, threads or thread mutual exclusion, virtual memory, or cache control must be satisfied by the layer above this driver.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00  ssc  09/05/21 First release
1.1   ssc  03/24/22 New error code XTRNGPSV_ERROR_GLITCH and doxygen fixes
1.4   mmd  07/10/23 Included header file for crypto algorithm information
      ng   06/30/23 Added support for system device-tree flow
</pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
